<template>
  <Row>
    <Col span="24">
    <Button
      type="text"
      :class="{active:'companyNews' == $route.path.split('/', 3)[2]}"
      @click="activeShow('companyNews')"
    >公司新闻</Button>
    <Button
      type="text"
      :class="{active:'companyAnnouncements'==$route.path.split('/', 3)[2]}"
      @click="activeShow('companyAnnouncements')"
    >公司公告</Button>
    <Button
      type="text"
      :class="{active:'activityForecast'==$route.path.split('/', 3)[2]}"
      @click="activeShow('activityForecast')"
    >活动预告</Button>
    </Col>
  </Row>
</template>

<script>
export default {
  data() {
    return {
      show: this.$route.path.split("/", 3)[2]
    }
  },
  methods: {
    activeShow(type) {
      console.log(this.show)
      switch (type) {
        case 'companyNews':
          this.$router.push({
            name: 'companyNews'
          })
          break;
        case 'companyAnnouncements':
          this.$router.push({
            name: 'companyAnnouncements'
          })
          break;
        case 'activityForecast':
          this.$router.push({
            name: 'activityForecast'
          })
          break;
      }
    }
  }
}
</script>

<style scoped>
</style>